From: Jo-Philipp Wich Date: Wed, 9 Nov 2022 19:26:14 +0000 (+0100) Subject: luci-base: cbi.js: await L.ui load before updating tables X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=bdfdd95a273f6fc73017795805dcfe6ee1ae8a8e;p=project%2Fluci.git luci-base: cbi.js: await L.ui load before updating tables On legacy views, the `L.ui` JavaScript class is not automatically loaded, so request it before updating tables. Fixes: e0e6989a4a ("luci-base: introduce new LuCI.ui.Table class") Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 65ea6bce3c..3fc6edf29f 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -796,5 +796,7 @@ document.addEventListener('DOMContentLoaded', function() { L.hideTooltip(ev); }); - document.querySelectorAll('.table').forEach(cbi_update_table); + L.require('ui').then(function(ui) { + document.querySelectorAll('.table').forEach(cbi_update_table); + }); });